package com.lipengcheng.feign.clients;

import com.lipengcheng.feign.common.dto.Item;
import com.lipengcheng.feign.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("itemservice")
public interface ItemFeignClient {
    @GetMapping("/item/list")
    PageDTO<Item> selectPage(@RequestParam(value = "page") Integer page, @RequestParam("size") Integer size);

    @GetMapping("/item/{id}")
     Item getById(@PathVariable("id")Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
     void reduceStock(@PathVariable Long itemId,@PathVariable Integer num );
}
